package com.chunxuan.langquan.dao.bean;

import com.contrarywind.interfaces.IPickerViewData;

import java.util.List;

public class JsonBean implements IPickerViewData {
    /**
     * name : 省份
     * cityList : [{"name":"北京市","code": "110000","areaList":["东城区","西城区","朝阳区"]}]
     */

    /**
     * "code": "110000",
     * "name": "北京市",
     * "cityList": [
     * {
     * "code": "110000",
     * "name": "北京市",
     * "areaList": [
     * {
     * "code": "110101",
     * "name": "东城区"
     * },
     * {
     * "code": "110102",
     * "name": "西城区"
     * },
     * {
     * "code": "110105",
     * "name": "朝阳区"
     * }
     * ]
     * }
     * ]
     */

    private String name;
    private String code;
    private List<CityBean> cityList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public List<CityBean> getCityList() {
        return cityList;
    }

    public void setCityList(List<CityBean> cityList) {
        this.cityList = cityList;
    }

    // 实现 IPickerViewData 接口，
    // 这个用来显示在PickerView上面的字符串，
    // PickerView会通过IPickerViewData获取getPickerViewText方法显示出来。
    @Override
    public String getPickerViewText() {
        return this.name;
    }

    public static class CityBean implements IPickerViewData {
        /**
         * name : 城市
         * area : ["东城区","西城区","崇文区","昌平区"]
         */

        /**
         * "code": "110000",
         * "name": "北京市",
         * "areaList": [
         * {
         * "code": "110101",
         * "name": "东城区"
         * },
         * {
         * "code": "110102",
         * "name": "西城区"
         * },
         * {
         * "code": "110105",
         * "name": "朝阳区"
         * }
         * ]
         */
        private String code;
        private String name;
        private List<AreaBean> areaList;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public List<AreaBean> getAreaList() {
            return areaList;
        }

        public void setAreaList(List<AreaBean> areaList) {
            this.areaList = areaList;
        }

        @Override
        public String getPickerViewText() {
            return this.name;
        }
    }


    public static class AreaBean implements IPickerViewData {
        private String code;
        private String name;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @Override
        public String getPickerViewText() {
            return this.name;
        }
    }
}
